package com.laicunba.util;

public class SynLocker {
	/**
	 * 加锁,一个小时后自动释放
	 * 
	 * @param locker
	 * @return
	 */
	public static boolean hasLock(String locker) {
		return CacheUtil.incr("syn.locker." + locker, 3600) > 1;
	}

	public static boolean clearLocker(String locker) {
		return CacheUtil.removeAttribute("syn.locker." + locker) == 1;
	}

}
